/**
 * @description 入驻结果
 */
import style from './styles/Result.less';
import classnames from "classnames";
import React from 'react';
import EntryBase from "../Common/EntryBase";
const Fragment = React.Fragment;

import { Button } from 'wd-mobile'

import img_success from "./images/success.png";
import img_hasbeen from "./images/hasbeen.png";

import util from "commons/util";
let query = util.parseQueryString();

const resultData = {
    "success": {
        img: img_success,
        mainText: "恭喜，您已成功提交申请！",
        subText: "审核时间一般为3个工作日，请耐心等待审核"
    },
    "hasbeen": {
        img: img_hasbeen,
        mainText: "您已经是我们的入驻商家了",
        subText: `更多功能，请登录 http://m.${location.host}/adminSeller 查看`
    }
}

class App extends React.Component {
    constructor(props) {
        super(props);
        this.state = {}
        this.data = resultData[this.props.match.params.type]
    }
    render() {
        return (
            <Fragment>
                {
                    !this.data && <div className={style.error}>入驻结果异常</div>
                }
                {
                    !!this.data && <div className={style.result}>
                        <img src={this.data.img} alt="" />
                        <div className={style.mainText}><span>{this.data.mainText}</span></div>
                        <div className={style.subText}><span>{this.data.subText}</span></div>
                        <Button className={style.button} onClick={()=>{
                            history.back();
                        }}>返回</Button>
                    </div>
                }
            </Fragment>
        )
    }
}

export default App;